package org.shangrila.app.sys.eo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SYS_ORGANIZATION database table.
 * 
 */
@Entity
@Table(name="SYS_ORGANIZATION")
@NamedQuery(name="SysOrganization.findAll", query="SELECT s FROM SysOrganization s")
public class SysOrganization implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private long id;

	private String active;

	private String description;

	private String fullname;

	private String name;

	@Column(name="\"TYPE\"")
	private String type;

	private long pid;

	//bi-directional many-to-one association to SysUser
	@OneToMany(mappedBy="sysOrganization")
	private List<SysUser> sysUsers;

	public SysOrganization() {
	}
	
	public SysOrganization(long id) {
		this.id = id;
	}

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getActive() {
		return this.active;
	}

	public void setActive(String active) {
		this.active = active;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getFullname() {
		return this.fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public List<SysUser> getSysUsers() {
		return this.sysUsers;
	}

	public void setSysUsers(List<SysUser> sysUsers) {
		this.sysUsers = sysUsers;
	}

	public SysUser addSysUser(SysUser sysUser) {
		getSysUsers().add(sysUser);
		sysUser.setSysOrganization(this);

		return sysUser;
	}

	public SysUser removeSysUser(SysUser sysUser) {
		getSysUsers().remove(sysUser);
		sysUser.setSysOrganization(null);

		return sysUser;
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

}